package com.fg.zrcommunity.mapper;

import com.fg.zrcommunity.bean.Admin;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 管理员的持久层
 */
@Mapper
public interface AdminMapper {

    // 查询全部数据
    @Select("select * from admin")
    List<Admin> selectAll() throws Exception;

    // 修改管理员状态
    @Update("update admin set state = !state where id = #{id}")
    void setState(int id) throws Exception;
}
